<?php
//删除管理圆代码
//获取管理员id和name
$id = $_GET['id'];
$name = $_GET['username'];

include_once 'conn.php';
if(is_numeric($id)){
//    写删除管理员的mysql语句
    $sql = "delete from info where id = $id";
//    执行mysql语句
    $result = mysqli_query($conn,$sql);
    if($result){
        echo "<script>alert('删除管理员成功');location.href='admin.php';</script>";
    }else{
        echo "<script>alert('删除管理员失败');history.back();</script>";
    }
}else{
    echo "<script>alert('参数错误，删除 $name 失败');history.back();</script>";
}


